/* Nav.css - 导航与侧边栏主页面样式表 */

/* 整体容器，采用纵向布局，占满整个视口 */
.nav-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #f5f5f5;
}

/* 顶部导航栏，水平排列，居中对齐，阴影分隔 */
.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* logo与标题区域，横向排列 */
.logo-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 32px;
  height: 32px;
}

.title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.risk-tip {
  color: #666;
  font-size: 14px;
}

/* 顶部右侧操作按钮组 */
.nav-actions {
  display: flex;
  gap: 12px;
}

.nav-actions button {
  padding: 6px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 会员按钮样式 */
.vip-btn {
  background-color: #ffe0b2; /* 浅橙色背景 */
  color: #e65100; /* 深橙色文字 */
}

.save-btn {
  background-color: #1976d2;
  color: white;
}

.share-btn,
.download-btn {
  background-color: #e0e0e0; /* 浅灰色背景 */
  color: #333;
}

.logout-btn {
  background-color: transparent;
  color: #666;
  box-shadow: none;
  padding: 0;
}

/* 主体区域，横向三栏布局 */
.nav-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 左侧侧边栏，竖直排列，顶部菜单+底部API/帮助 */
.sidebar {
  width: 80px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 0;
  border-right: 1px solid #eee;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 侧边栏菜单项，垂直居中，激活高亮 */
.sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 0;
  position: relative;
}

.sidebar-item.active {
  color: #1976d2;
  background-color: #e3f2fd; /* 激活时浅蓝背景 */
}

.sidebar-icon {
  font-size: 20px; /* 图标大小 */
}

.sidebar-label {
  font-size: 11px; /* 标签字体 */
}

/* 激活侧边栏的左侧高亮条 */
.sidebar-active-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #1976d2;
  border-radius: 0 2px 2px 0;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.sidebar-api, .sidebar-help {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 0;
}

.api-btn {
  font-size: 12px;
  color: #666;
}

.help-icon {
  font-size: 24px;
}

.help-label {
  font-size: 12px;
}

/* 左侧内容区域（模板/素材/文字） */
.template-sidebar-content,
.material-sidebar-content {
  width: 300px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #eee;
}

/* 搜索框区域，带放大镜icon */
.sidebar-search-container {
  padding: 16px;
  position: relative;
}

.sidebar-search-container input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.search-icon {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

/* 模板分类标签栏 */
.template-tabs {
  display: flex;
  padding: 0 16px;
  gap: 16px;
  border-bottom: 1px solid #eee;
}

.template-tab {
  padding: 12px 0;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  position: relative;
}

.template-tab.active {
  color: #1976d2;
}

.template-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #1976d2;
}

.template-color-picker {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-left: auto;
  cursor: pointer;
}

/* 素材子分类标签栏 */
.material-subcategory-tabs {
  display: flex;
  padding: 0 16px;
  gap: 16px;
  border-bottom: 1px solid #eee;
}

.material-subcategory-tab {
  padding: 12px 0;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  position: relative;
}

.material-subcategory-tab.active {
  color: #1976d2;
}

.material-subcategory-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #1976d2;
}

/* 素材子分类筛选标签（如基础形状/实心/空心等） */
.material-sub-filters {
  display: flex;
  padding: 12px 16px;
  gap: 14px;
  border-bottom: 1px solid #eee;
  overflow-x: auto;
}

.material-sub-filter-tab {
  padding: 6px 12px;
  font-size: 12px;
  color: #666;
  background-color: #f5f5f5;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
}

.material-sub-filter-tab.active {
  background-color: #1976d2;
  color: white;
}

/* 素材网格布局，2列，间距12px */
.material-item-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
}

.material-grid-item {
  aspect-ratio: 2;
  background-color: #f5f5f5;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

/* 收藏icon，悬浮时显示 */
.favorite-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s;
}

.material-grid-item:hover .favorite-icon {
  opacity: 1;
}

/* 形状类素材的基础样式 */
.shape-item {
  background-color: white;
  border: 1px solid #eee;
}

.material-grid-item.hollow-shape-item {
  background-color: transparent;
  border: 1px solid #eee;
}

/* 各种形状的样式（圆、三角、方、心、六边形等） */
.shape-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #1976d2;
}

.shape-triangle {
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid #1976d2;
}

.shape-square {
  width: 40px;
  height: 40px;
  background-color: #1976d2;
}

.shape-rect {
  width: 50px;
  height: 30px;
  background-color: #1976d2;
}

.shape-star {
  font-size: 32px;
  color: #1976d2;
}

.shape-heart {
  width: 40px;
  height: 40px;
  background-color: #1976d2;
  position: relative;
  transform: rotate(45deg);
}

.shape-heart::before,
.shape-heart::after {
  content: '';
  width: 40px;
  height: 40px;
  background-color: #1976d2;
  border-radius: 50%;
  position: absolute;
}

.shape-heart::before {
  left: -20px;
}

.shape-heart::after {
  top: -20px;
}

.shape-hexagon {
  width: 40px;
  height: 40px;
  background-color: #1976d2;
  position: relative;
}

.shape-hexagon::before,
.shape-hexagon::after {
  content: '';
  position: absolute;
  width: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
}

.shape-hexagon::before {
  bottom: 100%;
  border-bottom: 11.5px solid #1976d2;
}

.shape-hexagon::after {
  top: 100%;
  border-top: 11.5px solid #1976d2;
}

/* 线条样式（实线、点线、虚线、波浪线） */
.shape-line {
  width: 60px;
  height: 2px;
  background-color: #1976d2;
}

.shape-line.dotted {
  border-top: 2px dotted #1976d2;
  background: none;
}

.shape-line.dashed {
  border-top: 2px dashed #1976d2;
  background: none;
}

.shape-squiggly {
  width: 60px;
  height: 2px;
  border-bottom: 2px solid transparent;
  background: repeating-linear-gradient(90deg, #1976d2 0 2px, transparent 0 4px);
  background-size: 100% 100%;
  background-position: 0 100%;
}

/* 箭头样式（右箭头、实心、空心） */
.shape-arrow-right {
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 20px solid #1976d2;
}

/* 图片容器样式（圆、三角、方） */
.image-container-item {
  background-color: white;
  border: 1px solid #eee;
}

.image-container-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container-triangle {
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 60px solid #f5f5f5;
  position: relative;
}

.image-container-square {
  width: 60px;
  height: 60px;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-placeholder-icon {
  font-size: 24px;
}

/* 中间画布区域，居中显示 */
.canvas-area {
  flex: 1;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.canvas-placeholder {
  text-align: center;
  color: #666;
}

.canvas-tip-icons {
  font-size: 24px;
  margin-bottom: 12px;
}

.canvas-tip {
  font-size: 14px;
  line-height: 1.6;
}

/* 会员提示横幅 */
.canvas-vip-banner {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
}

/* 右侧工具栏，竖直排列 */
.tools-bar {
  width: 280px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #eee;
}

.tools-tabs {
  display: flex;
  padding: 16px;
  gap: 16px;
  border-bottom: 1px solid #eee;
}

.tools-tab {
  font-size: 14px;
  color: #666;
  cursor: pointer;
  padding: 4px 0;
  position: relative;
}

.tools-tab.active {
  color: #1976d2;
}

.tools-tab.active::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #1976d2;
}

.tool-content {
  flex: 1;
  overflow-y: auto;
}

/* 工具列表，3列网格 */
.tool-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
}

.tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background-color: #f5f5f5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  color: #666;
  position: relative;
}

/* 工具项HOT/NEW标记 */
.tool-item.hot::before {
  content: 'HOT';
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: #ff4d4f;
  color: white;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 2px;
}

.tool-item.new::before {
  content: 'NEW';
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: #52c41a;
  color: white;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 2px;
}

.tool-icon {
  font-size: 24px;
}

/* 右侧底部图标区 */
.tools-bottom {
  padding: 16px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tools-bottom-icons {
  display: flex;
  gap: 12px;
}

.tools-bottom-icons span {
  width: 32px;
  height: 32px;
  background-color: #f5f5f5;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #666;
  cursor: pointer;
}

.tools-bottom-zoom {
  font-size: 14px;
  color: #666;
}

/* 占位图样式（无内容时） */
.template-placeholder,
.material-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
}

.no-template-img {
  width: 120px;
  height: 120px;
  background-color: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 16px;
}

.no-template-text {
  font-size: 14px;
}

/* 工具占位符 */
.tools-placeholder {
  height: 100%;
  background-color: #f5f5f5;
}

/* 新增形状样式（气泡、手机、徽章、圆角矩形、星爆、网格、流动形状、旗帜、2024数字等） */
.shape-speech-bubble {
  width: 60px;
  height: 40px;
  background-color: #1976d2;
  border-radius: 10px;
  position: relative;
}
.shape-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 15px;
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-top-color: #1976d2;
  border-left-color: #1976d2;
  transform: rotate(45deg);
}

.shape-phone {
  width: 30px;
  height: 50px;
  border: 2px solid #1976d2;
  border-radius: 5px;
  position: relative;
}
.shape-phone::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 3px;
  background-color: #1976d2;
  border-radius: 2px;
}
.shape-phone::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border: 1px solid #1976d2;
  border-radius: 50%;
}

.shape-badge {
  width: 40px;
  height: 40px;
  background-color: #1976d2;
  border-radius: 50%;
  position: relative;
}
.shape-badge::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 10px;
  background-color: #1976d2;
  border-radius: 5px 5px 0 0;
}

.shape-rounded-rect {
  width: 50px;
  height: 30px;
  background-color: #1976d2;
  border-radius: 8px;
}

.shape-starburst {
  width: 40px;
  height: 40px;
  background-color: #1976d2;
  position: relative;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.shape-grid {
  width: 45px;
  height: 45px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  background-color: #1976d2;
  padding: 2px;
}
.shape-grid > div {
  background-color: white;
}

.shape-flowing-shape {
  width: 60px;
  height: 30px;
  background-color: #1976d2;
  border-radius: 15px 15px 15px 15px / 30px 30px 0 0;
  transform: rotate(10deg);
}

.shape-flag {
  width: 50px;
  height: 30px;
  background-color: #1976d2;
  position: relative;
}
.shape-flag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -5px;
  width: 5px;
  height: 40px;
  background-color: #666;
}

/* 2024数字样式 */
.shape-numbers-2024 {
  font-size: 24px;
  font-weight: bold;
  color: #1976d2;
}

/* 箭头样式（实心/空心） */
.shape-arrow-solid {
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 20px solid #1976d2;
}

.shape-arrow-hollow {
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 20px solid transparent;
  position: relative;
}

.shape-arrow-hollow::after {
  content: '';
  position: absolute;
  top: -9px;
  left: -18px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 18px solid #fff;
}

/* 新增的空心形状样式（所有 hollow 类） */
.shape-circle.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}

.shape-triangle.hollow {
  border-bottom-color: transparent;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid transparent;
  position: relative;
}

.shape-triangle.hollow::after {
  content: '';
  position: absolute;
  top: 0;
  left: -20px;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid #1976d2;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transform: scale(0.9);
  transform-origin: 50% 100%;
}

.shape-square.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}

.shape-rect.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}

.shape-star.hollow {
  color: transparent;
  -webkit-text-stroke: 1px #1976d2;
  text-stroke: 1px #1976d2;
}

.shape-heart.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}

.shape-heart.hollow::before,
.shape-heart.hollow::after {
  background-color: transparent;
  border: 2px solid #1976d2;
}

.shape-hexagon.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}
.shape-hexagon.hollow::before,
.shape-hexagon.hollow::after {
  border-bottom-color: transparent;
  border-top-color: transparent;
  border: 2px solid #1976d2;
}

.shape-speech-bubble.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}
.shape-speech-bubble.hollow::after {
  border-top-color: #1976d2;
}

.shape-phone.hollow {
  border: 2px solid #1976d2;
}
.shape-phone.hollow::before,
.shape-phone.hollow::after {
  background-color: transparent;
  border: 1px solid #1976d2;
}

.shape-badge.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}
.shape-badge.hollow::before {
  background-color: transparent;
  border: 2px solid #1976d2;
  border-bottom: none;
}

.shape-rounded-rect.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}

.shape-starburst.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}

.shape-grid.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}
.shape-grid.hollow > div {
  background-color: transparent;
  border: 1px solid #1976d2;
}

.shape-flowing-shape.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}

.shape-flag.hollow {
  background-color: transparent;
  border: 2px solid #1976d2;
}

.shape-numbers-2024.hollow {
  color: transparent;
  -webkit-text-stroke: 1px #1976d2;
  text-stroke: 1px #1976d2;
}

/* 文字样式区（略，已详细注释在原文件） */